package com.myspringsecurity.controller;

import lombok.extern.java.Log;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author ：Q大侠
 * @date ：Created in 2022/11/1 19:15
 * @description：控制层
 * @modified By：
 * @version:
 */
@Controller
@Log
public class PageController {
        @GetMapping("info")
        @ResponseBody
        public Authentication info(){
            return SecurityContextHolder.getContext().getAuthentication();
        }
        @PostMapping("/success")
        public String success(){
            ///templates/success.html
            return "success";
        }
}
